package com.situ.mall.observer.readernewspaper;

public class Client {
    public static void main(String[] args) {
        //创建一个报纸
        NewsPaper newsPaper = new NewsPaper();
        //创建阅读者，也就是观察者
        Reader reader1 = new Reader("张三");
        Reader reader2 = new Reader("李四");
        //注册阅读者
        newsPaper.addObserver(reader1);
        newsPaper.addObserver(reader2);
        //又要出报纸了
        newsPaper.setContent("本期的内容是观察者模式");
    }
}
